const schemas = {
  "addTask": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "getTaskDetail": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          },
          "baseInfo": {
            "required": [
              "productName",
              "productVersion",
              "planName",
              "status",
              "operatorName",
              "launchFrom",
              "startTime",
              "endTime",
              "duration"
            ],
            "type": "object",
            "description": "测试任务基本信息",
            "properties": {
              "productName": {
                "type": "string",
                "description": "产品名称"
              },
              "productVersion": {
                "type": "string",
                "description": "产品版本号"
              },
              "planName": {
                "type": "string",
                "description": "测试方案名称"
              },
              "status": {
                "type": "string",
                "description": "状态，可取值：\nrunning – 正在执行\nwaiting – 等待执行\nrunover – 已执行\nterminated – 已终止"
              },
              "operatorName": {
                "type": "string",
                "description": "运行人员名称"
              },
              "launchFrom": {
                "type": "string",
                "description": "发起方式，可取值：web、jenkins"
              },
              "startTime": {
                "type": "string",
                "description": "任务开始时间"
              },
              "endTime": {
                "type": "string",
                "description": "任务结束时间"
              },
              "duration": {
                "type": "string",
                "description": "运行时长"
              }
            }
          },
          "targetConfig": {
            "description": "目标配置",
            "type": "array",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "envConfig": {
            "type": "array",
            "description": "环境配置",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "stressConfig": {
            "type": "array",
            "description": "压力配置",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "selfConfig": {
            "type": "array",
            "description": "自定义配置",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "policy": {
            "type": "object",
            "required": [
              "type"
            ],
            "description": "执行策略",
            "properties": {
              "type": {
                "type": "string",
                "description": "策略类型，可取值：\nnow – 立即执行\ndelay – 延迟执行\ncycle – 周期执行"
              },
              "delay": {
                "type": "number",
                "description": "延迟时间，单位：min，仅当type=delay时有效"
              },
              "count": {
                "type": "number",
                "description": "执行次数，仅当type=cycle时有效"
              },
              "cycle": {
                "type": "string",
                "description": "周期类型，仅当type=cycle时有效，可取值：\neveryday - 每天，everyhour - 每小时"
              },
              "timepoint": {
                "type": "string",
                "description": "周期执行的时间点，仅当type=cycle时有效，\n示例：12:30"
              }
            }
          },
          "caseResults": {
            "type": "array",
            "description": "任务中的测试用例执行结果列表",
            "items": {
              "type": "object",
              "properties": {
                "caseId": {
                  "type": "number",
                  "description": "测试用例ID，对应MySQL主键"
                },
                "status": {
                  "type": "string",
                  "description": "测试状态，可取值：\nrunning – 正在测试\nwaiting – 等待测试\nrunover – 已测试"
                },
                "successRate": {
                  "type": "number",
                  "description": "成功率"
                },
                "result": {
                  "type": "string",
                  "description": "用例测试结果，可取值：OK、NOK"
                }
              },
              "required": [
                "caseId",
                "status"
              ]
            }
          }
        },
        "required": [
          "optResult",
          "baseInfo",
          "targetConfig",
          "envConfig",
          "policy"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "getListOntasks": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          },
          "totalDataCount": {
            "type": "number",
            "description": "总记录数"
          },
          "tasks": {
            "type": "array",
            "description": "任务列表",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "任务ID，对应Mongo主键"
                },
                "productName": {
                  "type": "string",
                  "description": "产品名称"
                },
                "productVersion": {
                  "type": "string",
                  "description": "产品版本号"
                },
                "planName": {
                  "type": "string",
                  "description": "方案名称"
                },
                "operatorName": {
                  "type": "string",
                  "description": "运行人"
                },
                "launchFrom": {
                  "type": "string",
                  "description": "发起方式"
                },
                "startTime": {
                  "type": "string",
                  "description": "发起时间"
                }
              },
              "required": [
                "id",
                "productName",
                "productVersion",
                "planName",
                "operatorName",
                "launchFrom",
                "startTime"
              ]
            }
          }
        },
        "required": [
          "optResult",
          "totalDataCount",
          "tasks"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "getListOvertasks": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          },
          "totalDataCount": {
            "type": "number",
            "description": "总记录数"
          },
          "tasks": {
            "type": "array",
            "description": "任务列表",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "任务ID，对应Mongo主键"
                },
                "operatorName": {
                  "type": "string",
                  "description": "运行人"
                },
                "launchFrom": {
                  "type": "string",
                  "description": "发起方式"
                },
                "startTime": {
                  "type": "string",
                  "description": "发起时间"
                },
                "endTime": {
                  "type": "string",
                  "description": "结束时间"
                },
                "duration": {
                  "type": "string",
                  "description": "运行时长"
                },
                "passRate": {
                  "type": "number",
                  "description": "通过率"
                }
              },
              "required": [
                "id",
                "operatorName",
                "launchFrom",
                "startTime",
                "endTime",
                "duration",
                "passRate"
              ]
            }
          }
        },
        "required": [
          "optResult",
          "totalDataCount",
          "tasks"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "stopTeatTask": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  }
}

export default schemas;
